package ProOF.apl.problems.real;

import ProOF.apl.problems.real.functions.aRealFunction;
import ProOF.apl.problems.real.functions.fRealFunction;
import ProOF.apl.problems.real.operators.fRealOperator;
import ProOF.com.LinkerNodes;
import ProOF.gen.best.BestSol;
import ProOF.opt.abst.problem.meta.Objective;
import ProOF.opt.abst.problem.meta.Problem;
import ProOF.opt.abst.problem.meta.codification.Codification;

/**
 *
 * @author Hossomi
 */
public class RealProblem extends Problem<BestSol> {
	private BestSol			best = new BestSol();
	public aRealFunction	func;
	public fRealOperator	op;

	public RealProblem( fRealOperator op ) {
		this.op = op;
	}
	
	@Override
	public void services(LinkerNodes link) throws Exception {
		super.services(link);	
		func = link.get( fRealFunction.obj, func );
		link.add(op);
	}
	
	@Override
	public Codification NewCodification() throws Exception {
		return new RealCodification( func.dimension() );
	}

	@Override
	public Objective NewObjective() throws Exception {
		return new RealObjective();
	}

	@Override
	public BestSol best() {
		return best;
	}
	
	@Override
	public String name() {
		return "Real Function";
	}
	
}
